package com.ym.medical.domain.param;

import com.ym.common.annotations.CustomConstraint;
import com.ym.common.constant.BeanCovert;
import com.ym.base.enums.FlagEnum;
import com.ym.medical.domain.entity.PatientDetailEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;

import static com.ym.common.constant.ValidRule.Add;
import static com.ym.common.constant.ValidRule.Update;

/**
 * 患者家人对象 patient_detail
 *
 * @author ym
 * @date 2020-08-21
 */
@ApiModel("患者家人-修改")
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PatientDetailUpdateParam extends BeanCovert<PatientDetailEntity> {

	@ApiModelProperty("主键")
	@NotNull(message = "主键不能为空", groups = {Add.class, Update.class})
	private Long id;

	@ApiModelProperty("用户主键")
	private Long userId;

	@ApiModelProperty("姓名")
	@Size(max = 32, message = "姓名长度超过{max}", groups = {Add.class, Update.class})
	private String name;

	@ApiModelProperty("身份证号")
	@Size(max = 32, message = "身份证号长度超过{max}", groups = {Add.class, Update.class})
	private String idNo;

	@ApiModelProperty("体重")
	@Size(max = 10, message = "体重长度超过{max}", groups = {Add.class, Update.class})
	private String weight;

	@ApiModelProperty("性别")
	@Size(max = 2, message = "性别长度超过{max}", groups = {Add.class, Update.class})
	private String sex;

	@ApiModelProperty("出生日期")
	@Size(max = 16, message = "出生日期长度超过{max}", groups = {Add.class, Update.class})
	private String birthday;

	@ApiModelProperty("电话号码")
	@Size(max = 16, message = "电话号码长度超过{max}", groups = {Add.class, Update.class})
	private String phoneNo;

	@ApiModelProperty("与用户关系")
	@Size(max = 2, message = "与用户关系长度超过{max}", groups = {Add.class, Update.class})
	private String relation;

	@ApiModelProperty("默认选中")
	@NotEmpty(message = "默认选中不能为空", groups = {Add.class, Update.class})
	@Size(max = 2, message = "默认选中长度超过{max}", groups = {Add.class, Update.class})
	@CustomConstraint(FlagEnum.class)
	private String defaultUse;

	@ApiModelProperty("创建时间")
	@NotNull(message = "创建时间不能为空", groups = Add.class)
	private Date createTime;

	@ApiModelProperty("修改时间")
	private Date updateTime;

	@ApiModelProperty("状态")
	@NotEmpty(message = "状态不能为空", groups = {Add.class, Update.class})
	@Size(max = 2, message = "状态长度超过{max}", groups = {Add.class, Update.class})
	@CustomConstraint(FlagEnum.class)
	private String deleted;

}
